package com.entity.taskorder;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * 更换零部件表实体类
 */
@ApiModel("更换零部件表实体")
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("replacement_parts") // 映射到数据库表名
public class ReplacementPart {

    @ApiModelProperty(value = "主键ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "任务单ID（逻辑外键，关联 task_order.id）")
    @TableField("task_order_id")
    private Long taskOrderId;

    @ApiModelProperty(value = "设备安装信息表ID（逻辑外键，关联 product_install_info.id）")
    @TableField("product_install_info_id")
    private Long productInstallInfoId;

    @ApiModelProperty(value = "序号")
    @TableField("serial_number")
    private String serialNumber;

    @ApiModelProperty(value = "零部件名称")
    @TableField("part_name")
    private String partName;

    @ApiModelProperty(value = "规格")
    @TableField("specification")
    private String specification;

    @ApiModelProperty(value = "数量")
    @TableField("quantity")
    private String quantity;

    @ApiModelProperty(value = "单价（元）")
    @TableField("price")
    private Double price;

    @ApiModelProperty(value = "旧部件是否回收（0-未回收，1-已回收）")
    @TableField("is_old_part_returned")
    private String isOldPartReturned;

    @ApiModelProperty(value = "是否过质保（0-未过期，1-已过期）")
    @TableField("is_warranty_valid")
    private String isWarrantyValid;

    @ApiModelProperty(value = "收件人确认（签字或备注）")
    @TableField("recipient_confirmation")
    private String recipientConfirmation;

    @ApiModelProperty(value = "创建人")
    @TableField("created_by")
    private String createdBy;

    @ApiModelProperty(value = "创建时间，默认为当前时间")
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    private LocalDateTime createdTime;

    @ApiModelProperty(value = "是否删除（0-未删除，1-已删除）")
    @TableField("is_deleted")
    @TableLogic
    private Integer isDeleted;

    @ApiModelProperty(value = "状态（判断由确认单1填入还是由总结单2填入）")
    @TableField("status")
    private String status;
}